﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;

namespace PhuLeBooze
{
    public class Global : System.Web.HttpApplication
    {

        public static void RegisterRoutes(RouteCollection routes)
        {
            RouteTable.Routes.Ignore("{resource}.axd/{*pathInfo}");

        //   routes.MapPageRoute("procuctdetail", "{pagename}/{description}/{queryname}/{*queryvalues}", "~/{pagename}.aspx",false,
        //new RouteValueDictionary { { "queryname", "US" }, { "year", DateTime.Now.Year.ToString() } });


      //      routes.MapPageRoute("procuctdetail", "{pagename}/{description}/{queryname}/{*queryvalues}", "~/{pagename}.aspx", false,
      //new RouteValueDictionary { { "queryname", "US" }, { "year", DateTime.Now.Year.ToString() } });

            routes.MapPageRoute("procuctdetail", "procuctdetail/{id}/{*extrainfo}","~/procuctdetail.aspx", true,
                                    new RouteValueDictionary { 
                                        { "id", "20" }},
                                    new RouteValueDictionary { 
                                        { "id", @"[-_\w]+" }  });
            
            routes.MapPageRoute("newsdetail", "newsdetail/{id}/{*extrainfo}","~/newsdetail.aspx", true,
                                    new RouteValueDictionary { 
                                        { "id", "20" }},
                                    new RouteValueDictionary { 
                                        { "id", @"[-_\w]+" }  });



          //   routes.MapPageRoute(
          //    "ProductsByCategoryRoute",
          //    "Category/{categoryName}",
          //    "~/ProductList.aspx"
          //);
          //   routes.MapPageRoute(
          //       "ProductByNameRoute",
          //       "Product/{productName}",
          //       "~/ProductDetails.aspx"
          //   );

        }
        protected void Application_Start(object sender, EventArgs e)
        {
            try
            {
                RegisterRoutes(RouteTable.Routes);
                PhuLeBooze.UICode.CConfigSiteEntity.ReadConfig();

            }
            catch (Exception ex)
            {

            }
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}
